import {
  BwComPropSetConstValueComEnum,
  BwCustomComPropDataTypeEnum,
  BwCustomComEmitParamDataTypeEnum,
  BwCustomComSoltTypeEnum,
} from '../../../render/models'
import type {
  BwCustomComEmitInfoModel,
  BwCustomComSlotInfoModel,
  BwCustomComPropInfoModel,
} from '../../../render/models'

/** 组件属性 */
const comAttrs: Array<BwCustomComPropInfoModel> = [
  {
    key: 'class',
    name: 'classNames',
    isRequire: false,
    defaultValue: undefined,
    dataType: [
      BwCustomComPropDataTypeEnum.string,
      BwCustomComPropDataTypeEnum.array,
    ],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'gutter',
    name: '列元素之间的间距',
    isRequire: false,
    defaultValue: undefined,
    dataType: [
      BwCustomComPropDataTypeEnum.array,
      BwCustomComPropDataTypeEnum.string,
      BwCustomComPropDataTypeEnum.number,
    ],
    defaultValueDataType: BwCustomComPropDataTypeEnum.array,
    constValueSetCom: BwComPropSetConstValueComEnum.textarea,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'tag',
    name: '自定义元素标签',
    isRequire: false,
    defaultValue: 'div',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.input,
    constValueSetComProps: null,
    remark: '',
  },
  {
    key: 'justify',
    name: '主轴对齐方式',
    isRequire: false,
    defaultValue: 'start',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.select,
    constValueSetComProps: JSON.stringify({
      options: [
        {
          label: '居左',
          value: 'start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居右',
          value: 'end',
        },
        {
          label: '两端',
          value: 'space-between',
        },
        {
          label: '分布',
          value: 'space-around',
        },
      ],
    }),
    remark: '',
  },
  {
    key: 'align',
    name: '交叉轴对齐方式',
    isRequire: false,
    defaultValue: 'top',
    dataType: [BwCustomComPropDataTypeEnum.string],
    defaultValueDataType: BwCustomComPropDataTypeEnum.string,
    constValueSetCom: BwComPropSetConstValueComEnum.select,
    constValueSetComProps: JSON.stringify({
      options: [
        {
          label: '顶部',
          value: 'top',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '底部',
          value: 'bottom',
        },
      ],
    }),
    remark: '',
  },
  {
    key: 'wrap',
    name: '是否自动换行',
    isRequire: false,
    defaultValue: 'true',
    dataType: [BwCustomComPropDataTypeEnum.boolean],
    defaultValueDataType: BwCustomComPropDataTypeEnum.boolean,
    constValueSetCom: BwComPropSetConstValueComEnum.switch,
    constValueSetComProps: null,
    remark: '',
  },
]

/** 组件事件 */
const comEmits: Array<BwCustomComEmitInfoModel> = [
  {
    key: 'click',
    name: '点击时触发',
    params: [
      {
        paramKey: 'event',
        paramName: 'MouseEvent',
        paramDataType: BwCustomComEmitParamDataTypeEnum.object,
        remark: '',
      },
    ],
  },
]

/** 组件插槽 */
const comSlots: Array<BwCustomComSlotInfoModel> = [
  {
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'default',
      slotName: '默认插槽',
    },
  },
]

export const vantRowInfo = {
  comAttrs,
  comEmits,
  comSlots,
}
